package demo_0427;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MyMap {
    public static void main(String[] args) {
        Map<String,String> contacks = new HashMap<>();
        contacks.put("zhangsan","1234646156");
        contacks.put("lisi","13864646846");
        contacks.put("wangwu","13646464646");
        System.out.println(contacks);

        System.out.println(contacks.get("zhangsan"));
        System.out.println(contacks.containsKey("lisi"));
        System.out.println(contacks.containsValue(contacks.get("lisi")));
        System.out.println(contacks.size());
        System.out.println(contacks.isEmpty());

        Set<String> keySet = contacks.keySet();
        System.out.println(keySet);

        Collection<String> values = contacks.values();
        System.out.println(values);

        Set<Map.Entry<String,String>> entrySet = contacks.entrySet();
        System.out.println(entrySet);


    }
}
